﻿#ifndef SCRIPTMANAGER_H
#define SCRIPTMANAGER_H

#include <QWidget>
#include <QListWidgetItem>

namespace Ui {
class ScriptManager;
}

class ScriptManager : public QWidget
{
    Q_OBJECT

public:
    explicit ScriptManager(QWidget *parent = nullptr);
    ~ScriptManager();
    void ScanClasses();
    void ScanScripts(QString classname);
    bool CheckSave(QString scriptname);
    void LoadScript(QString scriptname);
protected:
    void closeEvent(QCloseEvent *event);
private slots:
    void on_btnAddClass_clicked();

    void on_btnAddScript_clicked();

    void on_btnDir_clicked();

    void on_btnRun_clicked();

    void on_listclasses_itemDoubleClicked(QListWidgetItem *item);

    void on_listnames_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);

    void on_plainTextEdit_textChanged();

    void on_listnames_itemClicked(QListWidgetItem *item);

    void on_btnDelelteScript_clicked();

    void on_btnDelelteClass_clicked();

    void on_btnSaveScript_clicked();

private:
    Ui::ScriptManager *ui;
    QString m_scriptDir;
    QStringList m_classList;
    QStringList m_scriptList;
    QString m_lastClass;
    QString m_lastScript;
    bool m_tag;
};

#endif // SCRIPTMANAGER_H
